<%--
  Created by IntelliJ IDEA.
  User: XYC
  Date: 2015/7/22
  Time: 11:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>
<link rel="stylesheet" href="${dean}/css/expode.css" type="text/css"/>
<html>
<head>
</head>
<body>
<div class="expode">
	<table>
		<tr>
			<td>
				<span>
					<input type="radio" name="judge" id="no"/>
					<label for="no">无</label>
				</span>

			</td>
		</tr>
		<tr>
			<td>
				<span>
					<input type="radio" name="judge" id="yes"/>
					<label for="yes">有</label>
				</span>
				<%--<span>
					<input type="checkbox" id="yibao" disabled="disabled"/>
					<label for="yibao">医保</label>
				</span>--%>
				<span>
					<input type="checkbox" id="chemical" disabled="disabled" value="1"/>
					<label for="chemical">化学品</label>
				</span>
				<span>
					<input type="checkbox" id="thing" disabled="disabled" value="2"/>
					<label for="thing">毒物</label>
				</span>
				<span>
					<input type="checkbox" id="x" disabled="disabled" value="3"/>
					<label for="x">射线</label>
				</span>
				<%--<span class="aa">
					<input type="checkbox" id="other" disabled="disabled"/>
					<label for="other">其他</label>
				</span>--%>
				<%--<input type="text"  class="other" value="其他" disabled="disabled"/>--%>
			</td>
		</tr>
	</table>
	<div class="store">
		<button onclick="saveData()">保存</button>
	</div>

</div>
<%--<script type="text/javascript" src="${js}/jquery.min.js" charset="UTF-8"></script>--%>
<%--<script src="${js}/jquery.min.js"></script>--%>
<script src="${dean}/js/baseDell.js"></script>
<script src="${dean}/js/jquery-1.11.1.min.js"></script>
<script src="${dean}/js/expode.js" type="text/javascript"></script>
<script src="${js}/dean.js" type="text/javascript"></script>
<script type="text/javascript">
	var exposureHistory=${exposureHistory};
	$(document).ready(function(){
		buttonInit(".store button");
		if(exposureHistory==""){
			return;
		}
		var arrayTemp = exposureHistory.exposurecode;
		if(arrayTemp==""){
			$('#no').prop('checked',true);
			return ;
		}
		$('#yes').prop('checked',true);
		var strs = arrayTemp.split("|");
		for(var i=0;i<strs.length-1;i++){
			$("td span input[value='"+strs[i]+"']").prop('checked',true);
		}
		$('td span input').removeAttr('disabled','disabled');
//    alert(insurance);

/*		BindClickWithInputShow(".insurance input[value='1']",".insurance input[type=text]","${dean}/img/card_bg");
		$(".insurance input[value=1]").click( function(){BindClickWithInputShow(".insurance input[value='1']",".insurance input[type=text]","${dean}/img/card_bg")});
		$(".insurance input[type=text]").focus(function(){textDefultShow(".insurance input[type=text]",true)});
		$(".insurance input[type=text]").blur(function(){textDefultShow(".insurance input[type=text]",false)});*/
	});


	function saveData(){
		var temp="";
		if($('#yes').prop('checked')){
			$(" input[type=checkbox]:checked").each(function(){
				temp = temp +$(this).val()+"|";
			});
		}

		var data=new Object();
		data["idCard"]=exposureHistory.idCard;
		data["exposurecode"]=temp;

		jQuery.ajax({
			url :'${ctx}/web/patient/expodeHistory/SaveOrUpdata',
			type : "post",
			data:data,
			cache : false,
			dataType : "json",
			success : function(data){
				alert("提交完成");
			}
		});
//		alert(temp);
	}
</script>
</body>
</html>
